import request from "./request.js";
export function login(data) {
  return request({
    url: "/api/user/login",
    method: "get",
    data,
  });
}
// 获取商家状态
export function getStoreStatus() {
  return request({
    url: "/api/bbusiness/detail",
    method: "get",
  });
}

//商家提交入驻
export function joinUs(data) {
  return request({
    url: "/api/bbusiness/join",
    method: "post",
    data,
  });
}
//商家修改资料
export function resetStoreData(data) {
  return request({
    url: "/api/bbusiness/edit",
    method: "post",
    data,
  });
}

// 商家订单
export function getStoreOrder(data) {
  return request({
    url: "/api/border/list",
    mehod: "get",
    data,
  });
}

// 商家接单
export function takeStoreOrder(data) {
  return request({
    url: "/api/border/take",
    data,
    method: "get",
  });
}

// 商家出餐
export function sendStoreOrder(data) {
  return request({
    url: "/api/border/send",
    mehtod: "get",
    data,
  });
}

//商家产品分类
export function getStoreType(data) {
  return request({
    url: "/api/bcategory/list",
    method: "get",
    data,
  });
}

// 商家分类下产品
export function getStoreTypePro(data) {
  return request({
    url: "/api/bgoods/list",
    method: "get",
    data,
  });
}

// 商家产品详情
export function getProDetail(data) {
  return request({
    url: "/api/bgoods/detail",
    method: "get",
    data,
  });
}

// 新增产品
export function addProduction(data) {
  return request({
    url: "/api/bgoods/add",
    method: "post",
    data,
  });
}

// 修改产品
export function updateProduction(data) {
  return request({
    url: "/api/bgoods/update",
    method: "post",
    data,
  });
}

//删除产品
export function deleteProduction(data) {
  return request({
    url: "/api/bgoods/delete",
    method: "get",
    data,
  });
}

export function addType(data) {
  return request({
    url: "/api/bcategory/add",
    method: "post",
    data,
  });
}

export function updateType(data) {
  return request({
    url: "/api/bcategory/saveOrUpdate",
    method: "post",
    data,
  });
}

export function deleteType(data) {
  return request({
    url: "/api/bcategory/delete",
    method: "get",
    data,
  });
}

// 钱包余额
export function getWallet() {
  return request({
    url: "/api/bwallet/my",
    method: "get",
  });
}

// 新增提现
export function payMoney(data) {
  return request({
    url: "/api/btAmountOut/add",
    method: "post",
    data,
  });
}

// 提现记录
export function recordsList() {
  return request({
    url: "/api/btAmountOut/list",
    mehod: "get",
  });
}

// 账号流水
export function walletList() {
  return request({
    url: "/api/bwallet/list",
    mehod: "get",
  });
}

export function getOrderStatus(data) {
  return request({
    url: "/api/order/process",
    method: "get",
    data,
  });
}

export function getOrderDetail(data) {
  return request({
    url: "/api/order/detail",
    method: "get",
    data,
  });
}

// 修改是否自动接单
export function editAutoOrders(data) {
  return request({
    url: "/api/bbusiness/edit",
    method: "post",
    data,
  });
}
// 查询是否自动接单
export function getAutoOrders(data) {
  return request({
    url: "/api/bbusiness/detail",
    method: "get",
    data,
  });
}

export function getMyInfo() {
  return request({
    url: "/api/user/my",
    method: "get",
  });
}
export function avatarNickname(data) {
  return request({
    url: "/api/user/edit",
    method: "post",
    data,
  });
}
